<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log(0.2+0.1==0.3)//false;
        // Number.isInfinite(),判断是否为有限数，返回布尔值：
        console.log(Number.isFinite(20));//true
        console.log(Number.isFinite(NaN));//false
        console.log(Number.isFinite(Infinity));//false
        console.log(Number.isFinite(20/10));//true
        console.log(Number.isFinite(20/0))//false

        // Number.isNaN()判断是否为不是数字：
        console.log(Number.isNaN(0))//false
        console.log(Number.isNaN(NaN))//true

        // Number.isIntager()判断是否为整数返回布尔值：
        console.log(Number.isInteger(4.3));//false
        console.log(Number.isInteger(4));//true
        console.log(Number.isInteger(4.0))//true

        // Math.trunc()去除小数：
        console.log(Math.trunc(3.4));//3
        console.log(Math.trunc(3.2));//3
        console.log(Math.trunc(3.900879));//3

        // Math.sign()判断是否为整数：整数=1，负数=0，0=0
        console.log(Math.sign(3))//1
        console.log(Math.sign(-9))//-1
        console.log(Math.sign(0))//0

    </script>
</body>
</html>